public static class VectorExtensions
{
    public static Vector2 Bezier2(Vector2 start, Vector2 point, Vector2 end, float t)
    {
        // 使用两次线性插值实现二阶贝塞尔
        Vector2 p0 = Vector2.Lerp(start, point, t);
        Vector2 p1 = Vector2.Lerp(point, end, t);
        return Vector2.Lerp(p0, p1, t);
    }

    public static Vector2 Bezier3(Vector2 start, Vector2 point1,Vector2 point2, Vector2 end, float t)
    {
        // 使用两次线性插值实现二阶贝塞尔
        Vector2 p0 = Vector2.Lerp(start, point1, t);
        Vector2 p1 = Vector2.Lerp(point1, point2, t);
        Vector2 p2 = Vector2.Lerp(point2, end, t);
        
        Vector2 p01 = Vector2.Lerp(p0, p1, t);
        Vector2 p12 = Vector2.Lerp(p1, p2, t);
        return Vector2.Lerp(p01, p12, t);
    }
    
    public static Vector3 Bezier2(Vector3 start, Vector3 point, Vector3 end, float t)
    {
        // 使用两次线性插值实现二阶贝塞尔
        Vector3 p0 = Vector3.Lerp(start, point, t);
        Vector3 p1 = Vector3.Lerp(point, end, t);
        return Vector3.Lerp(p0, p1, t);
    }

    public static Vector3 Bezier3(Vector3 start, Vector3 point1,Vector3 point2, Vector3 end, float t)
    {
        // 使用两次线性插值实现二阶贝塞尔
        Vector3 p0 = Vector3.Lerp(start, point1, t);
        Vector3 p1 = Vector3.Lerp(point1, point2, t);
        Vector3 p2 = Vector3.Lerp(point2, end, t);
        
        Vector3 p01 = Vector3.Lerp(p0, p1, t);
        Vector3 p12 = Vector3.Lerp(p1, p2, t);
        return Vector3.Lerp(p01, p12, t);
    }
}